package com.zdkj.edge.door.demo.utils;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Arrays;
import java.util.List;

/**
 * @Description:
 * @Author: xuc
 * @Date: 2025-04-27-19:54
 */
@Getter
@AllArgsConstructor
public enum EntranceEnum {
    //(1：大入、2：大出、3：小进、4：小出
    ENTER("Y",Arrays.asList("1","3")),
    OUT("N",Arrays.asList("2","4"));

    private final String code;

    private final List<String> descriptions;

    public static String getByName(String name) {
        for (EntranceEnum entranceEnum : EntranceEnum.values()) {
            if (entranceEnum.getDescriptions().contains(name)) {
                return entranceEnum.getCode();
            }
        }
        return null;
    }

}
